package net;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;

public class TcpClientDemo01 {
    public static void main(String[] args) {
        try {
            Socket socket = new Socket("127.0.0.1", 6666);

            OutputStream out = socket.getOutputStream();

            // 要发送的数据
            String content = "我们的开始，是很长的电影";
            out.write(content.getBytes());

            // 关闭资源
            out.close();
            socket.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
